# coding: utf-8
import numpy as np
from pylab import plt
import os

an_ban = ["罐壁暗斑"]
liang_ban = ["罐壁亮斑", "罐壁白斑", "亮斑"]
ao_guan = ["凹罐"]
ditu = ["滴涂"]
fentuan = ["粉涂暗"]

root_path = r"D:\yingjun.wang\projects\qt\analysisAnnot"

files = fentuan

out = []
for file_path in files:
    o = np.loadtxt(os.path.join(root_path, file_path + ".txt"))
    out += [o]
out = np.concatenate(out)

area = out[:, 0]
gray = out[:, 1]

min_area = area.min()
max_area = area.max()
hista, edgesa = np.histogram(area, range=(0, 200), bins=200, density=False)

plt.figure(), plt.plot(hista),plt.title("area")

min_gray = gray.min()
max_gray = gray.max()
histg, edgesg = np.histogram(gray, bins=255, density=False)
plt.figure(), plt.plot(histg),plt.title("gray")

plt.show()
x = 0
x += 1